package cn.java76.spring1.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class AopTest2 {
    public static void main(String[] args) {
        ApplicationContext context=new ClassPathXmlApplicationContext("aop2.xml");
        System.out.println(Arrays.toString(context.getBeanDefinitionNames()));
        StudentService studentService=context.getBean(StudentService.class);
        List<Student> all = studentService.findAll();

        System.out.println("再test中：结果是：");
        all.forEach(System.out::println);
    }
}
